import Vue from 'vue'
import Vuex from 'vuex'

const files = require.context('./modules', false, /\.js$/)

const moduleContent = {}
files.keys().forEach((val) => {
  moduleContent[val.replace(/\.\/|\.js$/g, '')] = files(val).default
})
Vue.use(Vuex)

export default new Vuex.Store({
  store: {},
  modules: {
    ...moduleContent
  }

})
